<script type="text/javascript" language="javascript">
    var http_request = false;
    function makePOSTRequest(url) {
        var request = new XMLHttpRequest();
        request.open("POST", url, true);
        request.setRequestHeader("Content-Type", "text/xml");
        debug.log( this, 'that', { request : 'other' } );

        // Declare a ready state change event
        request.onreadystatechange = function () {
            if (request.readyState == 4) {
                if (request.status == 200) {
                    // Data from URL was retrieved successfully
                    document.getElementById('myspan').innerHTML = request.responseText;
                } else {
                    // The server returned an HTTP code other than 200
                    alert('There was a problem with the request.');
                }
            }
        };

        request.send(
                '<xpathsearch>' +
                '<ldap_base>o=grid</ldap_base>' +
                '<use_ldap_aux>true</use_ldap_aux>' +
                '<output_ldap_dn>true</output_ldap_dn>' +
                '<output_all_ldap_attributes>false</output_all_ldap_attributes>' +
                '<action>evaluate</action>' +
                '<host_url>ldap://is.grid.iu.edu:2170</host_url>' +
                '<expr>//GlueSE/GlueSEControlProtocol/@GlueSEControlProtocolEndpoint</expr>' +
                '</xpathsearch>'
                );

    }

    function get(obj) {
        makePOSTRequest('http://127.0.0.1:9998/jersey/xpathsearch');
    }
</script>
<script type="text/javascript" src="ba-debug.js"></script>

<form action="javascript:get(document.getElementById('myform'));" name="myform" id="myform">
    <input type="button" name="button" value="Submit"
           onclick="javascript:get(this.parentNode);">
</form>

<br>
Server-Response:<br>
<hr>
<span name="myspan" id="myspan"></span>
<hr>